<script setup lang="ts">
// 导入vant的按钮组件
import { Button } from 'vant'

// 导入stores/index.ts文件
import { useUserStore } from './stores/index'
const store = useUserStore()

// 缺少导入rq
import { rq } from './utils/request'

// 获取用户信息
const getUserInfo = async () => {
  const res = await rq('/inthepink/myUser', 'get')
  console.log(res)
}

</script>

<template>
  <div>
    <!-- 缺少按钮 -->
    <Button type="primary" @click="getUserInfo">获取用户信息</Button>
    
    <pre>






      
    </pre>
    
    <!-- ,点击"登陆"按钮调用stores保存用户信息数据对象,点击"退出"按钮,删除用户信息对象 -->
    <Button @click="store.setUser({'token':'123456789',id:'666', account:'http://www.xxxx.com', mobile:'15244667237', avatar:''})">登陆</Button>
    <Button type="warning" @click="store.delUser()">退出</Button>
    
    <pre>



      
    </pre>
    <!-- 使用按钮 -->
  <Button type="primary">点击我</Button>
  <Button type="warning">警告按钮</Button>
  </div>
</template>

<style scoped>

</style>
